<!--conf
<sample>
               <product version="3.0" edition="std"/>
                       <modifications>
                               <modified date="110701"/>
                       </modifications>
               </sample>
 -->
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	
	<title>Two grids on one datastore</title>
</head>

<body>
	<div id="gridbox" style="width:600px; height:270px; background-color:white;"></div>

	<div id="gridbox2" style="width:600px; height:270px; background-color:white;"></div>

	<input type="button" value="delete" onclick='data.remove(data.first())'>
	<input type="button" value="add" onclick='data.add({},0)'>
	
<script>
	var data = new dhtmlXDataStore({
		url:"../common/data/data.json",
		datatype:"json",
		
	});

    mygrid = new dhtmlXGridObject('gridbox');
    mygrid.setImagePath("../../../codebase/imgs/");
	mygrid.setSkin("dhx_skyblue")
	mygrid.setHeader("Count,Name");
	mygrid.setColumnIds("Maintainer,Version")
	//set cell's title from datastore
	mygrid.attachEvent("onRowCreated", function(id){
		mygrid.cells(id,0).setAttribute("title", mygrid.getRowAttribute(id, "Package"));
	})
	mygrid.init();
	mygrid.sync(data);
	
	
	

    mygrid2 = new dhtmlXGridObject('gridbox2');
    mygrid2.setImagePath("../../../codebase/imgs/");
	mygrid2.setSkin("dhx_skyblue")
	mygrid2.setHeader("Count,Name");
	mygrid2.init();
	mygrid2.setColumnIds("Maintainer,Package")
	mygrid2.sync(data);


	mygrid2.unsync(data)
	mygrid2.destructor();

	
</script>
<hr>
<input type='button' value='unsync grid 1' onclick='mygrid.unsync(data)'>
<input type='button' value='unsync grid 2' onclick='mygrid2.unsync(data)'>
</body>
</html>
